home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 6 / Amiga Format AFCD06 (Nov 1996, Issue 90).iso / serious / shareware / misc / vark15 / utils a-o / extract c-h < prev    next >
Text File  |  1996-08-26  |  4KB  |  105 lines

  1. ; crummy multiArchive extractor : By Neil Mohr 
  2. ; $VER: crummy multilzx extractor v1.0b (15:08 28 Jan 1996)
  3. ; Modified by Vark for Vark 15, cos I'm a lazy bastard
  4. ; It's too hot today anyway :)
  5. ;all specified archives must be in the same directory, with lha
  6. ;start with file1, file2 .. don't intersperse entries
  7.  
  8. (complete 0)
  9. (welcome)
  10.  
  11. (if (OR (= (getDevice @icon) "DF0") (= (getDevice @icon) "DF1") (= (getDevice @icon) "DF2"))
  12.     (set originalDisc (getAssign (getDevice @icon) "d")) )
  13. (set @default-dest "")
  14. (set @app-name "")
  15. (set counter 0)
  16. (foreach "" "#?.lha" (set counter (+ counter 1)) )
  17. (set completeVal (+ counter 1))
  18. (set destPrompt "Where do you want the archives extracting?")
  19.  
  20. (user 2)
  21. (message "\n\n\nTo use this installer properly you need\na hard drive, or at "
  22.          "least, plenty of free memory.\n\n\nAlso this icon should be in the same "
  23.          "directory as the archives, and LHA in c: otherwise it will not work!")
  24.  
  25. (set file1  "CleanDisk.Lha")
  26. (set file2  "CRBExec.Lha")
  27. (set file3  "DD1066.Lha")
  28. (set file4  "DiskFull.Lha")
  29. (set file5  "FastECS040.Lha")
  30. (set file6  "FastIprefs4028.Lha")
  31. (set file7  "FixRombo.Lha")
  32. (set file8  "FMSDisk.Lha")
  33. (set file9  "HappyENV.Lha")
  34. (set file10 "HD-Examine.Lha")
  35. (set file11 "HD-Player.Lha")
  36.  
  37. (while (OR (= (getAssign (getDevice @default-dest) "d") originalDisc )
  38.            (= originalDisc "") )
  39.   (set destination
  40.     (askdir (help @askdir-help) (prompt destPrompt)
  41.     (newpath)
  42.     (default "RAM:")
  43.   ))
  44. (set destPrompt "Where do you want the archives extracting?\nBut please don't pick the coverdisc!")
  45. (set @default-dest destination)
  46. )
  47.  
  48.  
  49. (if (NOT (= (substr @default-dest (- (strlen @default-dest) 1) 1) ":")) (set @default-dest (cat @default-dest "/")))
  50.  
  51. (if (= (getDevice @default-dest) "RAM")
  52.   (if (< (+(dataBase "total-mem")) 1000000) (message "\n\n\nYou may not have enough memory.\n\nPress proceed to try anyway."))
  53.   (if (< (getDiskSpace @default-dest)) 1000000 (message "\n\n\nYou may not have enough disc space.\n\nPress proceed to try anyway."))
  54. )
  55.  
  56. (set response (askoptions (prompt "Pick which archives to extract.") (help @askoptions-help) (choices
  57.  
  58. file1
  59. file2
  60. file3
  61. file4
  62. file5
  63. file6
  64. file7
  65. file8
  66. file9
  67. file10
  68. file11
  69.  
  70. )) )
  71.  
  72. (set counter (- counter 1))
  73.  
  74. (until (= counter -1)
  75.  
  76.   (if (IN response counter) ((set @app-name file11)  (set response (- response 1024)) ))
  77.   (if (IN response counter) ((set @app-name file10)  (set response (- response 512)) ))
  78.   (if (IN response counter) ((set @app-name file9)  (set response (- response 256)) ))
  79.   (if (IN response counter) ((set @app-name file8)  (set response (- response 128)) ))
  80.   (if (IN response counter) ((set @app-name file7)  (set response (- response 64)) ))
  81.   (if (IN response counter) ((set @app-name file6)  (set response (- response 32)) ))
  82.   (if (IN response counter) ((set @app-name file5)  (set response (- response 16)) ))
  83.   (if (IN response counter) ((set @app-name file4)  (set response (- response 8)) ))
  84.   (if (IN response counter) ((set @app-name file3)  (set response (- response 4)) ))
  85.   (if (IN response counter) ((set @app-name file2)  (set response (- response 2)) ))
  86.   (if (IN response counter) ((set @app-name file1)  (set response (- response 1)) ))
  87.  
  88.   (if (NOT (= @app-name ""))
  89.     ( (complete (* (- completeVal counter ) (/ 100 completeVal)) )
  90.       (working "\n\n\nI am now extracting " @app-name " to " @default-dest ".\n\nPlease Wait.")
  91.       (set unArc (cat "c:lha x -m -x \"" @app-name "\" \"" @default-dest "\""))
  92.       (if (> (run unArc) 0)  (message "lha reported an error when extracting\n" @app-name " to the destination path " @default-dest ".\n\nThis could either be a problem with how\nyour computer is setup or with the disk itself.\nTry running the HD-Setup Icon, and make sure you are running MultiExtract from the cover disk, it may be the destination " @default-dest " does not have enought room.\n\nIf problems persist ring 01625 878888 and ask for Amiga Computing Technical Help.\n\nPress Proceed To Continue." ))
  93.     )
  94.   )
  95.  
  96.   (set counter (- counter 1))
  97.   (set @app-name "")
  98.  
  99. )
  100.  
  101. (complete 100)
  102. (message "\n\n\n\nHopefully all your chosen files\nhave been extracted correctly!\n\nand can be found in " @default-dest)
  103.  
  104. (exit (quiet))
  105.